$(window).resize(function(){resizeBackground(false);});
$(window).load(function(){resizeBackground(true);});
var screenleft;
var screentop;
function resizeBackground(firstTime){
	screenleft = (screen.width)/2; 
	screentop = (screen.height)/2;
		if (document.getElementById("popup")&&firstTime){
			window.resizeTo($("#popup").width()+80, $("#popup").height()+90);			
			window.moveTo(screenleft-($("#popup").width()+80)/2, screentop-($("#popup").height()+80)/2);
			document.body.style.backgroundColor = "#F7F7F7";
			document.body.style.backgroundImage = "none";			
		}
		else
		{
			document.body.style.backgroundSize = window.innerWidth+"px "+window.innerHeight+"px";
		}
	}	

$('.toast').fadeIn(1000).delay(5000).fadeOut(1000);
function openPopUp(url){		
	var popup = window.open(url, '_blank', 'location=no, menubar=no, resizable=no, status=no, titlebar=no, toolbar=no, width=300, height=300');
	popup.moveTo(screenleft-150,  screentop-150);
	popup.onbeforeunload = function(){location.reload();}	
}
